//
//  VideoTypeCell.m
//  SnailPost
//
//  Created by Liuiu on 16/3/11.
//  Copyright © 2016年 抠泥ser. All rights reserved.
//

#import "VideoTypeCell.h"

@implementation VideoTypeCell


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        //img
        self.backGroundView = [[UIView alloc] init];
        [_backGroundView NightWithType:UIViewColorTypeNormal];
        [self.contentView addSubview:_backGroundView];
        
        self.img = [[UIImageView alloc]init];
        [_backGroundView addSubview:_img];
        
        self.name = [[UILabel alloc]init];
        _name.textAlignment = NSTextAlignmentCenter;
        [_name NightWithType:UIViewColorTypeNormal];
        [_backGroundView addSubview:_name];
        
        self.xian = [[UILabel alloc]init];
        _xian.backgroundColor = [UIColor gainsboroColor];
        [_xian NightWithType:UIViewColorTypeNormal];
        [_backGroundView addSubview:_xian];
    }
    return self;
}

-(void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    [_backGroundView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.contentView);
    }];
    [_img mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.contentView).with.insets(UIEdgeInsetsMake(self.contentView.frame.size.height / 5, self.contentView.frame.size.width / 3.5, self.contentView.frame.size.height *2 / 5,  self.contentView.frame.size.width / 3.5));
    }];
    
    [_name mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.contentView).with.insets(UIEdgeInsetsMake(self.contentView.frame.size.height *3 / 5, self.contentView.frame.size.width / 3.5, 0,  self.contentView.frame.size.width / 3.5));
    }];
   
    [_xian mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.contentView).with.insets(UIEdgeInsetsMake(0, self.contentView.frame.size.width - 2, 0, 1));
    }];
}

@end
